<?php 
//include('../Connections/KRAPPERCON.php');
$sql = 'call sp_getMonedas();';
$codmon = '';
$combo_mon = '';
$res = $mysqli->query($sql) or die($mysqli->error.__LINE__);
if ($res){
	if (isset($moneda)){
	$codmon = $moneda;
	}
	else if (isset($_POST['cbo_moneda'])) {
		$codmon = $_POST['cbo_moneda'];
	}
	else {
	$codmon = 'PEN'; //Por Defecto siempre marca PEN - Nuevos Soles
	}
		if (trim($codmon) != ""){
			while($row = $res->fetch_assoc()){
				$sel = '';
				if ($row['MoneyID'] == $codmon){ $sel = 'selected'; } else {  $sel = ''; }
				echo "<option ".$sel." value='".$row['MoneyID']."'>".$row['MoneyID']." - ".$row['MoneyNom']."</option>";	
				$combo_mon = $combo_mon."<option ".$sel." value='".$row['MoneyID']."'>".$row['MoneyID']." - ".$row['MoneyNom']."</option>";
			}		
		}
		else {
			while($row = $res->fetch_assoc()){
				echo "<option value='".$row['MoneyID']."'>".$row['MoneyNom']."</option>";	
			}
		}
	$res->close();
	$mysqli->check_result();
}
else {

}
?>